<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/mystyle.css">
    <link rel="stylesheet" href="layui/css/layui.css">
</head>

<body>
	<!-- 导入顶部导航---start -->
	<%@ include file="head.jsp" %>
	<!-- 导入顶部导航---end -->
	
    <div class="layui-container">
        <div class="def-all">
            <div class="def-head">
                <span>个人作品修改</span>
            </div>
            <form class="layui-form" action="upproduct.action" style="padding:15px;" enctype="multipart/form-data">
            <input type="hidden" name="userid" id="userid" value="${loginuser.userid }">
            <input type="hidden" id="worksid" name="worksid" value="${works.worksid}">
            <input type="hidden" id="stuinfoid" name="stuinfoid" value="${loginuser.stuinfoid}">
                <div class="layui-form-item">
                    <label class="layui-form-label">作品名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="worksname" name="worksname" lay-verify="" value="${works.worksname}"
                            autocomplete="off" placeholder="请输入作品名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">担任角色</label>
                    <div class="layui-input-block">
                        <input type="text" id="bear" name="bear" value="${works.bear}" lay-verify=""
                            placeholder="请输入担任角色" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">开始时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="startime" id="startime" value="${works.startime}"
                                lay-verify="inw-startime" placeholder="yyyy-MM-dd" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">结束时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="endtime" id="endtime" value="${works.endtime}"
                                lay-verify="inw-endtime" placeholder="yyyy-MM-dd" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">突出贡献</label>
                    <div class="layui-input-block">
                        <textarea id="contribution" name="contribution" 
                            placeholder="请描述自己做出的突出贡献" class="layui-textarea">${works.contribution}</textarea>
                    </div>
                </div>
              
				<div class="layui-upload inline-flex-center">
	            	<input type="hidden" name="account" id="account" value="${loginuser.account }">
	            	<input type="hidden" name="photoname" id="photoname" value="${works.achipic }">
	                <button type="button" class="layui-btn upselfhead-btn" style="background:#3AACDA;"
	                    id="grzpup">上传封面</button>
	                <div class="layui-upload-list">
	                    <img class="layui-upload-img upselfhead" id="demo1">
	                </div>
	                <p id="demoText" style="margin:0;"></p>
            	</div>
				
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">作品描述</label>
                    <div class="layui-input-block">
                        <textarea id="worksummary" name="worksummary"  placeholder="请输入作品描述"
                            class="layui-textarea">${works.worksummary}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                                <label class="layui-form-label">作品内容</label>
                                <div class="layui-input-block">
                                    <textarea id="editcontent" name="editcontent" style="display: none;" >${works.worksdetails }</textarea>
                                </div>
                        </div>
                
               <input type="hidden" name="titpic" id="titpic" value="">
                <div class="layui-upload">
                    <button type="button" class="layui-btn layui-btn-normal" id="testList">选择附件</button>
                    <div class="layui-upload-list">
                        <table class="layui-table">
                            <thead>
                                <tr>
                                    <th>文件名</th>
                                    <th>大小</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="demoList"></tbody>
                        </table>
                    </div>
                    <button type="button" class="layui-btn" id="testListAction">开始上传</button>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" type="submit" lay-filter="demo1">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        <button class="layui-btn layui-btn-danger" style="background:#FF5722;">删除</button>
                    </div>
                </div>
            </form>
        </div>

    </div>

    <!-- 导入网页页脚---start -->
	<%@ include file="foot.jsp" %>
	<!-- 导入网页页脚---end -->
	
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="layui/layui.js"></script>
    <script>
        
        layui.use('layedit', function(){
          var layedit = layui.layedit;
          var titpics=[];
          //图片上传全局接口
          layedit.set({
  			  uploadImage: {
    		  url: 'editfileuploadservlet.do?path=' + $("#account").val() //接口url  		  
    		  ,type: '', //默认post
    		  done: function (res) {
    		  		titpics.add(res.data.photoid);
    		  		$("#titpic").val(titpics);
    		  		alert(titpics);  	  		  
    		  	}
  			  }
		  });
		 //建立编辑器
          layedit.build('editcontent', {
            height: 350 //设置编辑器高度
            });
        });
        </script>
        
    <script src="js/my.js"></script>
</body>

</html>